package com.cn.demo.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

@JsonInclude(value= JsonInclude.Include.NON_NULL)
public class Teacher implements Serializable {
    /**
     * 编号
     */
    private String teacherId;

    /**
     * 电话
     */
    private String telephone;

    /**
     * 密码
     */
    private String password;

    /**
     * 姓名
     */
    private String teacherName;

    /**
     * 性别
     */
    private String sex;

    /**
     * 出生年月日
     */
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JsonFormat(locale="zh",  pattern="yyyy-MM-dd")
    private Date birth;


    /**
     * 职称
     */
    private String title;

    /**
     * 备注
     */
    private String remarks;

    /**
     * token令牌
     */
    private String token;

    /**
     * 登陆时间
     */
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(locale="zh",  pattern="yyyy-MM-dd HH:mm:ss")
    private Date landingTime;

    private static final long serialVersionUID = 1L;

    public String getTeacherId() {
        return teacherId;
    }

    public void setTeacherId(String teacherId) {
        this.teacherId = teacherId == null ? null : teacherId.trim();
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone == null ? null : telephone.trim();
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password == null ? null : password.trim();
    }

    public String getTeacherName() {
        return teacherName;
    }

    public void setTeacherName(String teacherName) {
        this.teacherName = teacherName == null ? null : teacherName.trim();
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex == null ? null : sex.trim();
    }

    public Date getBirth() {
        return birth;
    }

    public void setBirth(Date birth) {
        this.birth = birth;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title == null ? null : title.trim();
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks == null ? null : remarks.trim();
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token == null ? null : token.trim();
    }

    public Date getLandingTime() {
        return landingTime;
    }

    public void setLandingTime(Date landingTime) {
        this.landingTime = landingTime;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", teacherId=").append(teacherId);
        sb.append(", telephone=").append(telephone);
        sb.append(", password=").append(password);
        sb.append(", teacherName=").append(teacherName);
        sb.append(", sex=").append(sex);
        sb.append(", birth=").append(birth);
        sb.append(", title=").append(title);
        sb.append(", remarks=").append(remarks);
        sb.append(", token=").append(token);
        sb.append(", landingTime=").append(landingTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}